Drop/Create EHR Index Page#1084
Merged
labkey-martyp merged 3 commits intorelease25.7-SNAPSHOTfrom Jan 7, 2026
Merged
Conversation
labkey-jeckels
requested changes
Jan 6, 2026
Comment on lines
1113
to
1117
| String[] indexCols = new String[]{"participantid", "date", "include:taskid,lsid,category,observation,area,remark"}; | ||
| String indexName = getIndexName(schema.getSqlDialect(), tableName, indexCols); | ||
|
|
||
| List<String> cols = Arrays.asList("participantid", "date"); | ||
| String[] includedCols = new String[]{"taskid", "lsid", "category", "observation", "area", "remark"}; |
Contributor
There was a problem hiding this comment.
Why are these column lists hard-coded twice?
Contributor
Author
There was a problem hiding this comment.
I updated the hard coded values in this file and the common index here.
| { | ||
| List<String> messages = new ArrayList<>(); | ||
|
|
||
| EHRIndexContext ctx = prepareEHRIndexContext(c, messages); |
Contributor
There was a problem hiding this comment.
This feels over-engineered for a single index and under-engineered for supporting more indices in the future. Consider making prepareEHRIndexContext() return a List with a single entry for now, and iterate over the list when creating or dropping indices.
Contributor
Author
There was a problem hiding this comment.
Yeah I'm anticipating a lot of refactoring in this file as we look into these indices. I was planning on doing more refactoring at that point but went ahead and set this up more generically for more indices.
labkey-jeckels
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
Initially this page allows dropping and recreating the EHR index on the clinical_observations dataset to resolve an issue introduced in 25.7 (and fixed in 25.11) with recreating indices by name after updating a domain. This creates actions to drop the index manually and recreate it manually after the domain update is complete.
Additionally we'll keep these actions and page as we prepare for migration from SQL Server to Postgres and go through the other EHR indices to see which are still needed. Or if new ones are needed.
Changes